﻿package org.atk {
	import org.atk.components.treegridview.ITreeGridViewRowData;
	
	/**
	 * ...
	 * @author AeTky
	 */
	public class MyCellData implements ITreeGridViewRowData{
		private var caption:String;
		private var phone:String;
		private var mail:String;
		private var isNode:Boolean;
		public function MyCellData(caption:String,isNode:Boolean=false, phone:String=null, mail:String=null) {
			this.caption = caption;
			this.phone = phone;
			this.mail = mail;
			this.isNode = isNode;
		}
		
		/* INTERFACE org.atk.treegridview.ITreeGridViewRowData */
		
		public function getValue(columnIdx:int):*{
			switch(columnIdx) {
				case 0: return caption;
				case 1: if (isNode) return null; return phone;
				case 2: if (isNode) return null; return mail;
			}
			return null;
		}
		
		public function setValue(columnIdx:int, value:*):void{
			
		}
		
		public function get Caption():String { return caption; }
		
		public function set Caption(value:String):void {
			caption = value;
		}
		
		public function get Phone():String { return phone; }
		
		public function set Phone(value:String):void {
			phone = value;
		}
		
		public function get Mail():String { return mail; }
		
		public function set Mail(value:String):void {
			mail = value;
		}
		
		public function get IsNode():Boolean { return isNode; }
		
		public function set IsNode(value:Boolean):void {
			isNode = value;
		}
		
	}
	
}